/**
 * logger.h is part of cbs-framework.
 *
 * cbs-framework is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * cbs-framework is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with cbs-framework.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef GENETICLOGGER_H
#define GENETICLOGGER_H

#include <log4cpp/Category.hh>

using namespace log4cpp;

typedef enum {
    COUT_LOGGER = 0,
    FILE_LOGGER,
    N_LOGGER_TYPES
} LoggerType;

class Logger
{
public:

    Logger(const std::string & a_name = "Log.log", LoggerType a_type = COUT_LOGGER, Priority::PriorityLevel a_priority = log4cpp::Priority::NOTSET );

    CategoryStream LogError() const;
    CategoryStream LogWarn() const;
    CategoryStream LogDebug() const;
    CategoryStream LogInfo() const;

private:

    // Protect default copy constructor.
    Logger( const Logger & a_other );

    // Protect default operator =.
    Logger & operator = ( const Logger & a_other );

    log4cpp::Appender * GetAppender( const std::string & a_name, LoggerType a_type );

    Category &      m_category;
    LoggerType      m_type;

    static const std::string LOG_DIR;
};

#endif // GENETICLOGGER_H
